<template>
  <div>
    <!-- <el-dropdown class="el-icon-dropdown" placement="bottom-start">
      <span>
        明细
        <i class="el-icon-arrow-down el-icon--right"></i>
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item @click.native="queryDetails">查询明细</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
    <el-dropdown class="el-icon-dropdown" placement="bottom-start">
      <span>
        结算记录
        <i class="el-icon-arrow-down el-icon--right"></i>
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item @click.native="editHandle">查看结算记录</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
    <el-dropdown class="el-icon-dropdown" placement="bottom-start">
      <span>
        取消结算信息
        <i class="el-icon-arrow-down el-icon--right"></i>
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item @click.native="QueryOutThings">查询取消结算信息</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown> -->
    <!-- <el-dropdown class="el-icon-dropdown">
      <el-dropdown-item @click.native="queryDetails">查询明细</el-dropdown-item>
    </el-dropdown> -->
    <!-- <el-dropdown class="el-icon-dropdown">
      <el-dropdown-item @click.native="editHandle">查看结算记录</el-dropdown-item>
    </el-dropdown> -->
    <!-- <el-dropdown class="el-icon-dropdown">
      <el-dropdown-item @click.native="QueryOutThings">查询取消结算信息</el-dropdown-item>
    </el-dropdown> -->

    <!--条件筛选-->
    <TopFilter ref="topFilter" :list="topFilterList" :cols="3" labelWidth="110" @filterChange="changeHandle" @onCollapse="collapseHandle"></TopFilter>
    <!--操作 -->
    <button-area :style="{ paddingLeft: '80px' }"></button-area>
    <!-- 列筛选-->
    <FilterTable
      ref="table"
      columnsRef="ygy_queryAccount"
      :columns="columns"
      selectionType="single"
      :dataSource="dataSource"
      :isMemoryPagination="true"
      :pageSize="20"
      :datakey="'rows'"
      :summation="true"
      :isExportExcel="canExportExcel"
      exportFileName="查询结账.xlsx"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="selectData"
      :isServerColumnsRef="true"
    >
      <template slot="controls">
        <el-button size="small" type="primary" @click="openHandle">汇总</el-button>
      </template>
      <template slot="controls">
        <el-button size="small" type="primary" icon="el-icon-printer" @click="printSettle">打印</el-button>
      </template>
    </FilterTable>
    <Drawer title="汇总" :visible.sync="isShowSummary" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <Summary :formData="formData" @close="isShowSummary = false" />
    </Drawer>
    <!--查询结算记录明细抽屉 -->
    <Drawer :visible.sync="visible" :title="dialogTitle" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <ReportModal :rowData="tableData" @close="closeHandler" />
    </Drawer>
    <!--查询结账-->
    <Drawer :visible.sync="actions.visible1" :title="actions.title" :width="900" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <QueryDetails :type="actions.type" :formData="editData" @close="closeHandler" />
    </Drawer>
    <!--查询结账-->
    <BasePrint ref="print" :data="printLists" template="templatePrintQueryBalance" />

    <!--查询取消结算信息抽屉-->
    <Drawer
      :visible.sync="componentDrawer.visible"
      :title="componentDrawer.title"
      :width="920"
      destroyOnClose
      :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }"
    >
      <component :is="componentDrawerName" :params="fetchParams" :formData="editData" @close="closeHandler"></component>
    </Drawer>
    <!--查询取消结算信息抽屉-->
    <Drawer :visible.sync="visibleEdit" title="明细" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <editPanel :rowData="editPanelData" @close="closeEditPanel"></editPanel>
    </Drawer>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import moment from 'moment';
import { notifyAction, isFormEmpty } from '@/utils';
// 查询结算记录明细
import { getQuerySettlement, getSettlement } from '@/api/repair/queryStatistics/queryAccounts';
import { searchRoleByCode } from '@/api/common/empSelect/index';
import dictCode from '@/utils/dictCode';
import { getQueryEnterSituation, getAllUser } from '@/api/repair/queryStatistics/queryAccounts';
import ReportModal from './reportModal';
import editPanel from './editPanel';
import QueryOutThings from './selectOut/queryOutThingsModle';
import { getUserListSelect } from '@/api/report/repair/repairreport';
// import { getfindAllRepairType } from '@/api/repair/business/customer/history';
import { getSeries } from '@/api/customerRepair/customerCare/insuranceDueRemind/index';
import { getWxlxSelect } from '@/api/repair/repairReception/customer';
import Summary from './summary';
import { getBxgsSelect } from '@/api/repair/repairReception/customer';
import { menuUserAction } from '@/api/repair/repairReception/repairBusinessManger';

// QuerySettlement
export default {
  name: 'ygy_queryAccount',
  components: {
    Summary,
    ReportModal,
    QueryOutThings,
    editPanel
  },
  mixins: [dictionary],
  data() {
    this.conf = { add: '新增', delete: '删除', edit: '编辑', show: '显示' };
    return {
      topFilterList: this.createTopFilterList(),
      fetchParams: { xhrAbort: true },
      visible: false,
      visible1: false,
      dialogTitle: '',
      // fetchApi: getQuerySettlement,
      columns: this.createTableColumns(),
      isShowSummary: false,
      handleType: '',
      formData: {},
      editPanelData: {},
      tableData: [],
      ids: [],
      editData: [],
      rowData: {},
      printLists: {},
      visibleEdit: false,
      actions: { visible: false, type: '', title: '' }, // 弹出面板的相关信息
      componentDrawerName: null, // 抽屉组件名称
      componentDrawer: { visible: false, type: '', title: '' }, // 弹出抽屉面板的相关信息
      companyList: [], // 翻译保险公司
      dataSource: [],
      canExportExcel: false // 是否能够导出excel
    };
  },
  mounted() {
    // 分页
    // this.BaseTable = this.$refs.table.$refs.pageTable;
    this.initSelect();
    // this.getRepairType();
    // this.querySeries();
    this.getWxlxSelect();
    this.getBxgsSelect();
    this.queryMenuUserAction();
  },
  methods: {
    async getBxgsSelect() {
      const res = await getBxgsSelect();
      this.topFilterList.find(x => x.fieldName === 'insure').itemList = this.columns.find(item => item.dataIndex === 'INSURATION_CODE').dictItems = res.data.map(x => ({
        value: x.INSURATION_CODE,
        text: x.INSURATION_NAME
      }));

      res.data.map(x => (this.companyList[x.INSURATION_CODE] = x.INSURATION_NAME));
    },
    // 查询导出按钮权限
    async queryMenuUserAction() {
      let res = await menuUserAction();
      if (res.resultCode == 200) {
        res.data.forEach(item => {
          if (item.actionUrl == '/repair/queryStatistics/queryAccounts') {
            this.canExportExcel = true;
          }
        });
      }
    },
    async initSelect() {
      // 服务顾问
      let testDrive = { role: dictCode.SERVICE_CONSULTANT };
      const res = await searchRoleByCode(testDrive);

      let res5 = (await getAllUser()).data.map(x => ({ value: x.userId + '', text: x.employeeName }));
      this.columns.find(x => x.dataIndex === 'BALANCE_HANDLER').editItems = res5;
      this.columns.find(x => x.dataIndex === 'BALANCE_HANDLER').filterItems = res5;
      // this.columns.find(x => x.dataIndex === 'HANDLER').dictItems = res5;
      // this.columns.find(x => x.dataIndex === 'HANDLER').filterItems = res5;
      console.log(res, '服务顾问122222222');
      this.topFilterList.find(x => x.fieldName === 'serviceAdvisor').itemList = res.data.map(x => ({ text: x.employeeName, value: x.userId + '' }));
      // this.columns.find(x => x.dataIndex === 'BALANCE_HANDLER').editItems = res.data.map(x => ({ text: x.employeeName, value: x.userId + '' }));
      // this.columns.find(x => x.dataIndex === 'SERVICE_ADVISOR').filterItems = this.columns.find(x => x.dataIndex === 'SERVICE_ADVISOR').dictItems = res.data.map(x => ({
      //   text: x.employeeName,
      //   value: x.userId
      // }));
      this.columns.find(x => x.dataIndex === 'SERVICE_ADVISOR').filterItems = this.columns.find(x => x.dataIndex === 'SERVICE_ADVISOR').dictItems = res5; // 修改为全量人员 hxj 2020/6/11
      // this.columns.find(x => x.dataIndex === 'cashier').editItems = res5; 防止前端报错 此字段已注释
      // this.columns.find(x => x.dataIndex === 'cashier').filterItems = res5;
    },
    async queryAllSaler() {},

    //  async getRepairType() {
    //   const res = await getfindAllRepairType();
    //   let list = res.data.map(x => ({ text: x.REPAIR_TYPE_NAME, value: x.REPAIR_TYPE_CODE + '' }));
    //   this.columns.find(item => item.dataIndex === 'REPAIR_TYPE_CODE').editItems = list; // 维修类型
    // },
    // async querySeries() {
    //   // 车系ID翻译
    //   const car = await getSeries();
    //   console.log(car, '车系ID翻译');
    //   this.columns.find(x => x.dataIndex === 'SERIES').editItems = car.data.map(x => ({ text: x.SERIES_NAME, value: x.SERIES_ID + '' }));
    // },
    createTopFilterList() {
      return [
        {
          type: 'SELECT',
          label: '查询日期类型',
          fieldName: 'DATE_TYPE',
          placeholder: '请选择...',
          initialValue: '3',
          rules: [{ required: true, message: '请选日期类型', trigger: 'change' }],
          itemList: [
            // { text: '结算日期', value: '1' },
            { text: '出厂日期', value: '2' },
            { text: '结算日期', value: '3' }
            // { text: '出厂日期', value: '6' }
          ]
        },
        {
          type: 'RANGE_DATE',
          label: '日期范围',
          fieldName: 'beginDate|endDate',
          placeholder: '选择日期',
          initialValue: [moment(new Date()).format('YYYY-MM-DD'), moment(new Date()).format('YYYY-MM-DD')],
          rules: [{ required: true, message: '请选日期范围', trigger: 'change' }]
        },
        {
          type: 'INPUT',
          label: '工单号',
          fieldName: 'roNo'
        },
        {
          type: 'SELECT',
          label: '免费类委托书',
          fieldName: 'freeChange',
          placeholder: '请选择',
          itemList: [
            { text: '免费', value: '1001' },
            { text: '收费', value: '1002' }
          ]
        },
        {
          type: 'SELECT',
          label: '结算状态',
          fieldName: 'arrBalance',
          placeholder: '请选择...',
          itemList: [
            { text: '欠账', value: '10041001' },
            { text: '已审核', value: '10041002' },
            { text: '结算', value: '10041003' },
            { text: '未结清', value: '10041004' }
          ],
          change: val => {
            if (val !== '10041001') {
              this.topFilterList.find(item => item.fieldName === 'beginDate|endDate').rules = [{ required: true, message: '请选日期范围', trigger: 'change' }];
            } else {
              this.topFilterList.find(item => item.fieldName === 'beginDate|endDate').rules = [{ required: true, message: '请选日期范围', trigger: 'change' }];
            }
          }
        },
        {
          type: 'SELECT',
          label: '服务顾问',
          fieldName: 'serviceAdvisor',
          placeholder: '请选择',
          itemList: [],
          filterable: true,
          initialValue: ''
        },
        {
          type: 'SELECT',
          label: '保险公司',
          fieldName: 'insure',
          placeholder: '请选择',
          itemList: [],
          filterable: true,
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '车牌号',
          fieldName: 'license'
        },
        {
          type: 'INPUT',
          label: '担保方',
          fieldName: 'guarantor'
        },
        {
          type: 'MULTIPLE_SELECT',
          label: '维修类型',
          fieldName: 'REPAIR_TYPE_CODE',
          itemList: []
        },
        {
          type: 'SELECT',
          label: '业务类型',
          fieldName: 'YWLX',
          itemList: [
            { value: '维修', text: '维修' },
            { value: '备件', text: '备件' },
            { value: '精品', text: '精品' }
          ]
        }
        // {
        //   type: 'CHECKBOX',
        //   label: '包含免费类委托书',
        //   fieldName: 'cusId',
        //   options: {
        //     trueValue: '10041001',
        //     falseValue: '10141002'
        //   }
        // }
      ];
    },
    createTableColumns() {
      return [
        {
          title: '操作',
          dataIndex: 'column-action',
          fixed: 'left',
          render: props => {
            return (
              <div>
                <el-button size="mini" type="text" onClick={() => this.showDetail(props.row)}>
                  明细
                </el-button>
              </div>
            );
          }
        },
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '维修类别',
          dataIndex: 'WXLB',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '委托书编号',
          dataIndex: 'RO_NO',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '发票号',
          dataIndex: 'invoiceNo',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '发票类型',
          dataIndex: 'invoiceType',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '付款方式',
          dataIndex: 'payTypeCode',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          editItems: this.createDictList('8044')
        },
        {
          title: '是否使用代金券',
          dataIndex: 'IS_COUPON',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          render: props => {
            return <span>{props.row.IS_COUPON == 10041001 ? '是' : '否'}</span>;
          }
        },
        {
          title: '代金券金额',
          dataIndex: 'GIFT_AMOUNT',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2
        },

        // {
        //   title: '收银员',
        //   dataIndex: 'cashier',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'checkbox',
        //   filterItems: [],
        //   editType: 'select',
        //   editItems: []
        // },
        {
          title: '业务类型',
          dataIndex: 'YWLX',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '客户名称',
          dataIndex: 'OWNER_NAME',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '合计金额',
          dataIndex: 'TOTAL_AMOUNT',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_TOTAL_AMOUNT'
        },
        {
          title: '现金收款',
          dataIndex: 'XJSK',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_XJSK'
        },
        {
          title: '收款合计',
          dataIndex: 'REAL_SUM_HJ',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_REAL_SUM_HJ'
        },
        {
          title: '牌照号',
          dataIndex: 'LICENSE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },

        {
          title: '维修类型',
          dataIndex: 'REPAIR_TYPE_NAME',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '刷卡消费',
          dataIndex: 'Coupon_Amount',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_Coupon_Amount'
        },
        {
          title: '欠款金额',
          dataIndex: 'BALANCE_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_BALANCE_SUM'
        },
        {
          title: '发牌日期',
          dataIndex: 'LICENSE_DATE',
          width: 150,
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'date-range',
          editable: false,
          editType: 'date-picker',
          exportFormat: {
            t: 'd'
          }
        },
        {
          title: '行驶里程',
          dataIndex: 'MILEAGE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2
        },
        {
          title: '结算日期',
          dataIndex: 'BALANCE_TIME',
          width: 150,
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'date-range',
          editable: false,
          editType: 'date-picker',
          exportFormat: {
            t: 'd'
          }
        },
        {
          title: '出厂日期',
          dataIndex: 'DELIVERY_DATE',
          width: 150,
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'date-range',
          editable: false,
          editType: 'date-picker',
          exportFormat: {
            t: 'd'
          }
        },
        {
          title: '购车日期',
          dataIndex: 'SALES_DATE',
          width: 150,
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'date-range',
          editable: false,
          editType: 'date-picker',
          exportFormat: {
            t: 'd'
          }
        },
        {
          title: '生产日期',
          dataIndex: 'PRODUCT_DATE',
          width: 150,
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'date-range',
          editable: false,
          editType: 'date-picker',
          exportFormat: {
            t: 'd'
          }
        },
        {
          title: '结算员',
          dataIndex: 'BALANCE_HANDLER',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'checkbox',
          filterItems: [],
          editType: 'select',
          editItems: []
        },
        {
          title: '送修日期',
          dataIndex: 'CREATED_AT',
          width: 150,
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'date-range',
          editable: false,
          editType: 'date-picker',
          exportFormat: {
            t: 'd'
          }
        },
        {
          title: 'VIN',
          dataIndex: 'VIN',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '车型',
          dataIndex: 'MODEL_CODE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '车型名称',
          dataIndex: 'MODEL_NAME',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '客户电话',
          dataIndex: 'MOBILE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '发动机',
          dataIndex: 'ENGINE_NO',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '车系',
          dataIndex: 'SERIES_CODE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '车系名称',
          dataIndex: 'SERIES_NAME',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '顾客描述',
          dataIndex: 'CUSTOMER_DESC',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '故障描述',
          dataIndex: 'RO_TROUBLE_DESC',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        // {
        //   title: '工单状态',
        //   dataIndex: 'RO_STATUS',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        {
          title: '结算状态',
          dataIndex: 'BALANCE_STATUS',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '尊享/悦享',
          dataIndex: 'ZXYX',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          dictItems: this.createDictList(8104),
          filterType: 'checkbox',
          filterItems: [
            { text: '尊享', value: '81041004' },
            { text: '悦享', value: '81041003' }
          ]
        },
        {
          title: '使用套餐',
          dataIndex: 'TCBS',
          sorter: true,
          filter: true,
          filterType: 'checkbox',
          filterItems: [
            { text: '是', value: '10041001' },
            { text: '否', value: '10041002' }
          ],
          dictItems: this.createDictList(1004),
          render: props => {
            return <el-checkbox checked={props.row.TCBS == 10041001} disabled></el-checkbox>;
          }
        },
        {
          title: '新保',
          dataIndex: 'XB',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'checkbox',
          filterItems: this.createDictList(1004),
          dictItems: this.createDictList(1004),
          render: props => {
            return <el-checkbox value={!isFormEmpty(props.row.XB) ? props.row.XB : '10041002'} true-label="10041001" false-label="10041002" disabled={true}></el-checkbox>;
          }
        },
        {
          title: '延保',
          dataIndex: 'YB',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'checkbox',
          filterItems: this.createDictList(1004),
          dictItems: this.createDictList(1004),
          render: props => {
            return <el-checkbox value={!isFormEmpty(props.row.YB) ? props.row.YB : '10041002'} true-label="10041001" false-label="10041002" disabled={true}></el-checkbox>;
          }
        },
        {
          title: '会员编号',
          dataIndex: 'MEMBER_NO',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '应收工时费',
          dataIndex: 'RECEIVEABLE_LABOUR_FEE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_RECEIVEABLE_LABOUR_FEE'
        },
        {
          title: '实收工时费',
          dataIndex: 'REAL_LABOUR_FEE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_REAL_LABOUR_FEE'
        },
        {
          title: '应收材料费',
          dataIndex: 'SALE_PAR_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_SALE_PAR_SUM'
        },
        {
          title: '实收材料费',
          dataIndex: 'PAR_REAL_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_PAR_REAL_SUM'
        },
        {
          title: '包工方式',
          dataIndex: 'BG_TYPE',
          sorter: true,
          filter: true,
          filterItems: this.createDictList('8145'),
          dictItems: this.createDictList('8145')
        },
        {
          title: '包工费',
          dataIndex: 'BGF',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_BGF'
        },
        {
          title: '圆整金额',
          dataIndex: 'YZ_AMAOUNT',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_YZ_AMAOUNT'
        },
        {
          title: '税额',
          dataIndex: 'TAX_AMOUNT',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_TAX_AMOUNT'
        },
        {
          title: '索赔材料成本',
          dataIndex: 'REPAIR_PART_COST_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_REPAIR_PART_COST_SUM'
        },
        {
          title: '索赔材料费',
          dataIndex: 'REPAIR_PART_SALES_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_REPAIR_PART_SALES_SUM'
        },
        {
          title: '材料成本',
          dataIndex: 'REPAIR_PART_COST',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_REPAIR_PART_COST'
        },
        {
          title: '毛利',
          dataIndex: 'ML',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          summation: true,
          precision: 2
          // summationDataIndex: 'TOTAL_ML'
        },
        {
          title: '合计优惠',
          dataIndex: 'HJYH',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          summation: true,
          precision: 2
          // summationDataIndex: 'TOTAL_HJYH'
        },
        {
          title: '辅材费',
          dataIndex: 'FCF',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_FCF'
        },
        {
          title: '施救费',
          dataIndex: 'SJF',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_SJF'
        },
        {
          title: '担保方',
          dataIndex: 'GUARANTOR',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input'
        },
        {
          title: '保险公司',
          dataIndex: 'INSURATION_CODE',
          sorter: true,
          filter: true,
          editable: false,
          editType: 'select',
          editItems: [],
          dictItems: [],
          showOverflowTooltip: true,
          filterType: 'input',
          render: props => {
            return <span>{!isFormEmpty(props.row.INSURATION_CODE) ? this.companyList[props.row.INSURATION_CODE] : ''}</span>;
          }
        },
        {
          title: '套餐收入',
          dataIndex: 'TOTAL_DISCOUNT_AMOUNT',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_TOTAL_DISCOUNT_AMOUNT'
        },
        {
          title: '厂家支持',
          dataIndex: 'CJZC',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_CJZC'
        },
        {
          title: '其他费1',
          dataIndex: 'other1_amount',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_other1_amount'
        },
        {
          title: '其他费2',
          dataIndex: 'other2_amount',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_other2_amount'
        },
        {
          title: '其他费3',
          dataIndex: 'other3_amount',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_other3_amount'
        },
        {
          title: '备件销售金额',
          dataIndex: 'SALES_PART_REAL_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'number',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_SALES_PART_REAL_SUM'
        },
        {
          title: '收款金额',
          dataIndex: 'REAL_SUM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'input',
          precision: 2,
          summation: true
          // summationDataIndex: 'TOTAL_REAL_SUM'
        },
        {
          title: '服务顾问/销售顾问名称',
          dataIndex: 'SERVICE_ADVISOR',
          sorter: true,
          filter: true,
          dictItems: [],
          showOverflowTooltip: true,
          filterType: 'checkbox',
          filterItems: []
        }
        // {
        //   title: '维修类别',
        //   dataIndex: 'REPAIR_TYPE_CODE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input',
        //   editType: 'select',
        //   editItems: []
        // },
        // {
        //   title: '业务类型',
        //   dataIndex: 'RO_TYPE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '尊享/悦享',
        //   dataIndex: 'ZX_OR_YX',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '服务包',
        //   dataIndex: 'SERVICE_PKG_CODE',
        //   sorter: true,
        //   filter: true,
        //   editable: true,
        //   showOverflowTooltip: true,
        //   defaultEditable: true,
        //   editType: 'checkbox',
        //   editItems: [
        //     { text: '', trueValue: '1' },
        //     { text: '', falseValue: '0' }
        //   ]
        // },
        // {
        //   title: '延保',
        //   dataIndex: 'ACTIVITY_TRACE_TAG',
        //   sorter: true,
        //   filter: true,
        //   editable: true,
        //   showOverflowTooltip: true,
        //   defaultEditable: true,
        //   editType: 'checkbox',
        //   editItems: [
        //     { text: '', trueValue: '1' },
        //     { text: '', falseValue: '0' }
        //   ]
        // },
        // {
        //   title: '新车送保',
        //   dataIndex: 'IS_XB',
        //   sorter: true,
        //   filter: true,
        //   editable: true,
        //   showOverflowTooltip: true,
        //   defaultEditable: true,
        //   editType: 'select',
        //   editItems: this.createDictList('1004')
        // },
        // {
        //   title: '同步标识',
        //   dataIndex: 'SYNCH_TAG',
        //   sorter: true,
        //   filter: true,
        //   editable: true,
        //   showOverflowTooltip: true,
        //   defaultEditable: true,
        //   editType: 'checkbox',
        //   editItems: [
        //     { text: '', trueValue: '1' },
        //     { text: '', falseValue: '0' }
        //   ]
        // },
        // {
        //   title: '发票日期',
        //   dataIndex: 'SQUARE_DATE',
        //   width: 150,
        //   dateFormat: 'yyyy-MM-dd',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'date-range',
        //   editable: false,
        //   editType: 'date-picker'
        // },
        // {
        //   title: '电话',
        //   dataIndex: 'MOBILE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '车系',
        //   dataIndex: 'SERIES',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input',
        //   editType: 'select',
        //   editItems: []
        // },
        // // {
        // //   title: '车系名称',
        // //   dataIndex: 'SERIES_NAME',
        // //   sorter: true,
        // //   filter: true,
        // //   showOverflowTooltip: true,
        // //   filterType: 'input'
        // // },
        // {
        //   title: '是否使用套餐',
        //   dataIndex: 'SFSYTC',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // // {
        // //   title: '是否使用套餐',
        // //   dataIndex: 'SFSYTC',
        // //   sorter: true,
        // //   filter: true,
        // //   editable: true,
        // //   showOverflowTooltip: true,
        // //   defaultEditable: true,
        // //   editType: 'checkbox',
        // //   editItems: [
        // //     { text: '', trueValue:  '10041001'},
        // //     { text: '', falseValue: '10041002' }
        // //   ]
        // // },
        // {
        //   title: '底盘号',
        //   dataIndex: 'VIN',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '发动机号',
        //   dataIndex: 'ENGINE_NO',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '行驶里程',
        //   dataIndex: 'OUT_MILEAGE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '车型',
        //   dataIndex: 'MODEL',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '故障描述',
        //   dataIndex: 'RO_TROUBLE_DESC',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '客户描述',
        //   dataIndex: 'CUSTOMER_DESC',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '合计金额',
        //   dataIndex: 'TOTAL_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '收款合计',
        //   dataIndex: 'TOTAL_RECEIVE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '厂家优惠材料费',
        //   dataIndex: 'OEM_DISCOUNT_PART_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '厂家优惠工时费',
        //   dataIndex: 'OEM_DISCOUNT_LABOUR_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '厂家优惠现金',
        //   dataIndex: 'OEM_DISCOUNT_CASH',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '发票类型',
        //   dataIndex: 'INVOICE_TYPE_CODE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '发票号',
        //   dataIndex: 'INVOICE_NO',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '收款金额',
        //   dataIndex: 'RECEIVE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '结算员',
        //   dataIndex: 'BALANCE_HANDLER',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input',
        //   editType: 'select',
        //   editItems: []
        // },
        // {
        //   title: '送修日期',
        //   dataIndex: 'CREATED_AT',
        //   width: 150,
        //   dateFormat: 'yyyy-MM-dd',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'date-range',
        //   editable: false,
        //   editType: 'date-picker'
        // },
        // {
        //   title: '结算状态',
        //   dataIndex: 'BALANCE_STATUS',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '合计税额',
        //   dataIndex: 'TAX_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '应收工时费',
        //   dataIndex: 'RECEIVEABLE_LABOUR_FEE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '实收工时费',
        //   dataIndex: 'REAL_LABOUR_FEE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '应收材料费',
        //   dataIndex: 'SALE_PAR_SUM',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '实收材料费',
        //   dataIndex: 'PAR_REAL_SUM',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '代金券',
        //   dataIndex: 'COUPONM_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '包工费',
        //   dataIndex: 'BAOGONG_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '管理费',
        //   dataIndex: 'MANAGE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '辅材费',
        //   dataIndex: 'MANAGE_OVER_REAL_SUM',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '施救费',
        //   dataIndex: 'SAVE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '舍入金额',
        //   dataIndex: 'YZ_AMAOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '索赔工费',
        //   dataIndex: 'OEM_LABOUR_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '合计工时',
        //   dataIndex: 'TOTAL_HOUR',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '材料成本',
        //   dataIndex: '21111',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '索赔料费',
        //   dataIndex: 'OEM_REPAIR_PART_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'number'
        // },
        // {
        //   title: '索赔材料成本',
        //   dataIndex: 'OEM_REPAIR_PART_COST_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '包工方式',
        //   dataIndex: 'BAOGONG_TYPE',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '合计优惠',
        //   dataIndex: 'DERATE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '毛利',
        //   dataIndex: 'MAOLI',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '客户保险公司支付',
        //   dataIndex: 'CUSTOMER_INSURANCE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '对方保险公司支付',
        //   dataIndex: 'INSURANCE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '客户自付',
        //   dataIndex: 'CUSTOMER_OWN_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '会员卡号',
        //   dataIndex: 'MEMBER_NO',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '本次积分',
        //   dataIndex: 'THIS_POINTS',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '购车日期',
        //   dataIndex: 'SALES_DATE',
        //   width: 150,
        //   dateFormat: 'yyyy-MM-dd',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'date-range',
        //   editable: false,
        //   editType: 'date-picker'
        // },
        // {
        //   title: '发牌日期',
        //   dataIndex: 'LICENSE_DATE',
        //   width: 150,
        //   dateFormat: 'yyyy-MM-dd',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'date-range',
        //   editable: false,
        //   editType: 'date-picker'
        // },
        // {
        //   title: '生产日期',
        //   dataIndex: 'PRODUCT_DATE',
        //   width: 150,
        //   dateFormat: 'yyyy-MM-dd',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'date-range',
        //   editable: false,
        //   editType: 'date-picker'
        // },
        // {
        //   title: '出厂日期',
        //   dataIndex: 'OUT_DATE',
        //   width: 150,
        //   dateFormat: 'yyyy-MM-dd',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'date-range',
        //   editable: false,
        //   editType: 'date-picker'
        // },
        // {
        //   title: '相关班组',
        //   dataIndex: 'WORKGROUP',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '结算备注',
        //   dataIndex: 'REMARK',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '二手车标识',
        //   dataIndex: 'SECOND_HAND',
        //   sorter: true,
        //   filterType: 'input',
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterItems: this.createDictList('1004'),
        //   render: props => {
        //     return <span>{this.createDictText(props.row.SECOND_HAND, '1004')}</span>;
        //   }
        // },
        // // {
        // //   title: '二手车标识',
        // //   dataIndex: 'SECOND_HAND',
        // //   sorter: true,
        // //   filter: true,
        // //   editable: true,
        // //   showOverflowTooltip: true,
        // //   defaultEditable: true,
        // //   editType: 'checkbox',
        // //   editItems: [
        // //     { text: '', trueValue:  '10041001'},
        // //     { text: '', falseValue: '10041002' }
        // //   ]
        // // },
        // {
        //   title: '保险公司推荐',
        //   dataIndex: 'INSURANCE_RECOMMEND',
        //   sorter: true,
        //   filterType: 'input',
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterItems: this.createDictList('1004'),
        //   render: props => {
        //     return <span>{this.createDictText(props.row.INSURANCE_RECOMMEND, '1004')}</span>;
        //   }
        // },
        // // {
        // //   title: '保险公司推荐',
        // //   dataIndex: 'INSURANCE_RECOMMEND',
        // //   sorter: true,
        // //   filter: true,
        // //   editable: true,
        // //   defaultEditable: true,
        // //   editType: 'checkbox',
        // //   editItems: [
        // //     { text: '', trueValue:  '10041001'},
        // //     { text: '', falseValue: '10041002' }
        // //   ]
        // // },
        // {
        //   title: '保险公司',
        //   dataIndex: 'INSURATION_NO',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '现金',
        //   dataIndex: 'XJ',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // // {
        // //   title: '刷卡',
        // //   dataIndex: 'CREDIT_CARD_AMOUNT',
        // //   sorter: true,
        // //   filter: true,
        // //   showOverflowTooltip: true,
        // //   filterType: 'input'
        // // },
        // {
        //   title: '转账',
        //   dataIndex: 'TRANSFER_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '预收款',
        //   dataIndex: 'PRE_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // // {
        // //   title: '在线支付',
        // //   dataIndex: 'ZXZF',
        // //   sorter: true,
        // //   filter: true,
        // //   showOverflowTooltip: true,
        // //   filterType: 'input'
        // // },
        // {
        //   title: '银行卡',
        //   dataIndex: 'POS_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // // {
        // //   title: '会员预存',
        // //   dataIndex: 'HYYC',
        // //   sorter: true,
        // //   filter: true,
        // //   showOverflowTooltip: true,
        // //   filterType: 'input'
        // // },
        // {
        //   title: '微信',
        //   dataIndex: 'WECHAT_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '支付宝',
        //   dataIndex: 'ZFB_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '刷卡',
        //   dataIndex: 'CREDIT_CARD_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '翼支付',
        //   dataIndex: 'yzf',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '花呗',
        //   dataIndex: 'hb',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '余额宝',
        //   dataIndex: 'zfb',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '储值卡',
        //   dataIndex: 'eq',
        //   sorter: true,
        //   filter: true,
        //   showOverflowTooltip: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '网银',
        //   dataIndex: 'wy',
        //   sorter: true,
        //   filter: true,
        //   filterType: 'input'
        // },
        // {
        //   title: 'VISA',
        //   dataIndex: 'visa',
        //   sorter: true,
        //   filter: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '现金',
        //   dataIndex: 'xj',
        //   sorter: true,
        //   filter: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '微粒代',
        //   dataIndex: 'wsd',
        //   sorter: true,
        //   filter: true,
        //   filterType: 'input'
        // },
        // {
        //   title: '支票',
        //   dataIndex: 'CHECK_AMOUNT',
        //   sorter: true,
        //   filter: true,
        //   filterType: 'input'
        // }
      ];
    },
    // 打印
    async printSettle() {
      let data = await this.$refs.topFilter.GET_FORM_DATA();
      let res = await getSettlement(data[1]);
      this.printLists = res.data;
      let consultant = { role: dictCode.SERVICE_CONSULTANT }; // 服务顾问
      const consultantRes = await searchRoleByCode(consultant);
      consultantRes.data.map(x => {
        for (let i = 0; i < this.printLists.length; i++) {
          if (this.printLists[i].SERVICE_ADVISOR === x.userId + '') {
            this.printLists[i].SERVICE_ADVISOR = x.employeeName;
          }
        }
      });
      this.$refs.print.EXCUTE_PRINT();
      console.log(consultantRes.data, '服务顾问');
      console.log(this.printLists, '打印数据');
    },
    async getWxlxSelect() {
      const res = await getWxlxSelect();
      this.wxl = res.data.map(x => ({ value: x.REPAIR_TYPE_CODE, text: x.REPAIR_TYPE_NAME }));
      this.topFilterList.find(item => item.fieldName === 'REPAIR_TYPE_CODE').itemList = this.wxl;
    },
    QueryOutThings() {
      this.editData = this.tableData;
      this.componentDrawerName = QueryOutThings;
      this.componentDrawer = { visible: true, type: 'edit', title: '查询取消结算信息' };
    },
    // queryDetailss(val){
    //   this.printList=val;
    // },
    queryDetails() {
      if (this.tableData.length > 0) {
        this.jcdPrintList();
        this.$refs.print.EXCUTE_PRINT();
      } else {
        this.$notify.warning({ title: '提示信息', message: '请选择一条数据。' });
      }
    },
    selectData(val) {
      this.tableData = val;
    },
    addHandle() {
      // 新建
      this.handleType = 'add';
      // this.formData = row;
      this.showHandler();
    },
    editHandle() {
      this.handleType = 'edit'; // 编辑
      if (this.tableData.length > 0) {
        this.showHandler();
      } else {
        this.$message.warning('请选择一条数据');
      }
    },
    showDetail(val) {
      console.log('val', val);
      this.editPanelData = val;
      this.visibleEdit = true;
    },
    closeEditPanel() {
      this.visibleEdit = false;
    },
    async changeHandle(val) {
      this.fetchParams = Object.assign({}, val, {
        REPAIR_TYPE_CODE: val.REPAIR_TYPE_CODE ? val.REPAIR_TYPE_CODE.join("','") : ''
      });
      this.$refs.table.START_LOADING();
      try {
        // let res = await this.fetchApi(formParams[1] || {});
        let res = await getQuerySettlement(this.fetchParams);
        if (res.resultCode == 200) {
          this.dataSource = [...res.data];
          console.log(this.dataSource);
        }
      } catch (err) {
        console.log(err, '查询table主数据失败');
      } finally {
        this.$refs.table.STOP_LOADING();
      }
    },
    collapseHandle() {
      this.$nextTick(() => {
        this.$refs.table && this.$refs.table.EXECUTE_RESET_HEIGHT();
      });
    },
    async saveDialog() {
      let res = {};
      if (this.tableData == null) return;
      res = await addCustomeRgradeUpdatet({ customeRgradeUpdateDTOList: this.tableData });
      if (res.resultCode === 200) {
        this.closeDialog('refresh');
      }
    },
    async openHandle() {
      let data = await this.$refs.topFilter.GET_FORM_DATA();
      if (data[1].beginDate) {
        data[1].beginDate = data[1].beginDate.slice(0, 10) + ' 00:00:00';
        data[1].endDate = data[1].endDate.slice(0, 10) + ' 23:59:59';
      }
      this.formData = data[1];
      console.log('formData', this.formData);
      this.isShowSummary = true;
    },
    showHandler() {
      // 显示
      this.dialogTitle = `查看结算记录`;
      this.visible = true;
    },
    closeHandler(val, type) {
      // 关闭
      this.visible = val;
      if (type === 'refresh') {
        // 重新加载
        this.fetchParams = { ...this.fetchParams };
      }
    }
  }
};
</script>

<style lang="less" scoped></style>
